fix: handle remaining PHPUnit TestResult events in parallel state#1683
Open
stsepelin wants to merge 3 commits into
Open
fix: handle remaining PHPUnit TestResult events in parallel state#1683stsepelin wants to merge 3 commits into
stsepelin wants to merge 3 commits into
Conversation
2 tasks
Covers testSuiteSkippedEvents, errors, and the three
testRunnerTriggered{Deprecation,Notice,Warning} event collections so
that invalid datasets, runner-level issues, and skipped suites are
reflected in the parallel summary.
Extracts the shared shapes scattered across fromPhpUnitTestResult into private helpers: - addIssueEvents: per-triggering-test loops (deprecations, notices, warnings, errors). - addThrowableEvents: test()/throwable() loops (testFailedEvents and testMarkedIncompleteEvents). - addStandaloneEvents: the three runner-level event loops. - addTriggeredPhpunitEvents: now also accepts testConsideredRiskyEvents since it shares the same nested-array shape and test()/message() surface. No behavior change.
Drops the per-call counter in favour of the foreach index. Each caller already passes a unique className per event group, so className plus index is enough to keep every synthesised TestMethod id distinct without tracking mutable state on the generator.
788c461 to
6591c7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
Follow-up to #1655. Extends
Pest\Support\StateGeneratorto process thePHPUnit\TestRunner\TestResult\TestResultmethods it was still ignoring, so runner-level issues, skipped suites, and user-triggered errors show up in the parallel summary.Handlers added:
errors()→FAILtestSuiteSkippedEvents()→SKIPPEDtestRunnerTriggeredDeprecationEvents()→DEPRECATEDtestRunnerTriggeredNoticeEvents()→NOTICEtestRunnerTriggeredWarningEvents()→WARNRunner-level and suite-level events have no attached test, so they go through a small
addStandaloneEventhelper that synthesises aTestMethod— same approach already used for the fabricated passed-test entries.Two further commits tidy the surrounding code without changing behaviour:
addIssueEventsfor per-triggering-test events (deprecations, notices, warnings, the newerrors()),addThrowableEventsfortest()/throwable()pairs (failed + marked-incomplete), andaddStandaloneEventsfor the three runner-level event groups. The existingaddTriggeredPhpunitEventsnow also consumestestConsideredRiskyEvents, since it shares the same nested-array shape.TestMethodids are derived from the foreach index instead of a stateful counter — each call site already supplies a uniqueclassName, soclassName::event#<index>stays distinct.Unit coverage for each new handler lives in
tests/Unit/Support/StateGenerator.php.Related:
--parallelcauses overall process to fail with no reporting as to why even though all tests pass #1483 (visibility safety net for runner-level warnings)Closes #1462 (the "missing implementations in StateGenerator.php" part)